<?php
namespace app\manage\validate;

use think\Validate;

/**
 * 行为验证器
 * @package app\menus\validate
 * @author
 */
class Goods extends Validate
{
    //定义验证规则
    protected $rule = [
        'sort'=>'require|number',
        'name'  => 'require',
        'price'  => 'require',
        'img'  => 'require',
        'description'  => 'require',
        'stock'  => 'require|number',
        'unit'  => 'require',
        'engineer_rate'  => 'require|number',
        'receiver_rate'  => 'require|number',
    ];

    //定义验证提示
    protected $message = [
        'sort.require' => '请输入排序',
        'name.require' => '请输入名称',
        'price.require' => '请输入商品价格',
        'img.require' => '请添加商品图',
        'description.require' => '请输入商品描述',
        'stock.require' => '请输入商品库存',
        'unit.require' => '请输入单位',
        'engineer_rate.require' => '请输入技师提成',
        'engineer_rate.number' => '技师提成为整数',
        'receiver_rate.require' => '请输入接待提成',
        'receiver_rate.number' => '接待提成为整数',
    ];

}
